package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author: 徐波
 * @creat: 2017/11/23 0023 15:33
 * description:
 */
@Entity
@Table(name = "T_SYS_REGION", schema = "oa", catalog = "")
public class RegionEntity extends BaseEntity {

    private String name;
    private String parentId;
    private Integer sortNo;
    private String createUserId;
    private String companyId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public JSONObject getJSONObject(){
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("NAME", this.getName());
        obj.put("PARENT_ID", this.getParentId());
        obj.put("SORT_NO", this.getSortNo());
        obj.put("CREATE_USER_ID", this.getCreateUserId());
        obj.put("CREATE_TIME", this.getCreateTime());
        obj.put("DEL_FLAG",this.getDelFlag());
        obj.put("COMPANY_ID",this.getCompanyId());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_REGION";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("NAME", "name");
        obj.put("PARENT_ID", "parentId");
        obj.put("SORT_NO", "sortNo");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_TIME", "createTime");
        obj.put("DEL_FLAG","delFlag");
        obj.put("COMPANY_ID","companyId");

        return obj;
    }
}
